package com.atguigu.juc;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class test {
    public static void main(String[] args) {
        for (int i = 1; i <=10; i++) {
                    new Thread(() -> {
                        
                    },String.valueOf(i)).start();
                }
    }
    
    Lock lock = new ReentrantLock();
        public void sale()
        {
            lock.lock();
            try
            {
                int i = 0;
            }finally {
                lock.unlock();
            }
        }
}